# 2025-6-2
m = int(input())
n = int(input())
a = 1
while True:
    m*=a
    if m % n == 0:
        print(m)
        break
    else:
        m //=a
    a+=1